home *** CD-ROM | disk | FTP | other *** search
- unit ntc_server_config;
- {
- Copyright (C) 2004 - 2006 Andrew Sprott
-
- http://astronomy.crysania.co.uk
- astro@trefach.co.uk
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- }
-
- interface
-
- uses
- Windows,
- Messages,
- SysUtils,
- Variants,
- Classes,
- Graphics,
- Controls,
- Forms,
- Dialogs,
- StdCtrls,
- ExtCtrls,
- inifiles,
- Buttons,
-
- ntc_server_form,
- ntc_server_comms,
- ntc_server_object,
- ntc_server_observer;
-
- const
- mount_eq=0;
- mount_az=1;
-
- type
- Tscope_config = class(tform)
- config_panel: TPanel;
- model_group: TGroupBox;
- model_label: TLabel;
- model_list: TComboBox;
- hp_group: TGroupBox;
- switch_hpp_button: TButton;
- bug_group: TGroupBox;
- century_check: TCheckBox;
- seconds_check: TCheckBox;
- misc_group: TGroupBox;
- make_inis: TBitBtn;
- enable_scope_check: TCheckBox;
- mount_group: TRadioGroup;
- precision_label: TLabel;
- binary_check: TCheckBox;
-
- { form handling }
- procedure formcreate(
- sender:tobject);
-
- procedure update_precision_label;
-
- { utilities }
- function get_precision
- :boolean;
-
- { configuration }
- procedure load_settings;
-
- procedure save_settings;
-
- procedure write_escape_scopes;
-
- { events }
- procedure FormShow(
- Sender: TObject);
-
- procedure adjust;
-
- procedure check_activate(
- Sender: TObject);
-
- procedure model_listChange(
- Sender:TObject);
-
- procedure switch_hpp_buttonClick(
- Sender:TObject);
-
- procedure make_inisClick(
- Sender: TObject);
-
- procedure form_close_query(
- Sender: TObject;
- var CanClose: Boolean);
-
- procedure enable_scope_checkClick(
- Sender: TObject);
-
- procedure century_checkClick(
- Sender: TObject);
-
- procedure seconds_checkClick(
- Sender: TObject);
-
- procedure binary_checkClick(
- Sender: TObject);
-
- private
- { Private declarations }
- public
- { Public declarations }
- { configuration }
- dimensions:dimensions_record;
- high_precision:boolean;
- binary_mode:boolean;
- { debugging }
- scope_enabled:boolean;
- century_bug:boolean;
- seconds_bug:boolean;
- scope_type:word;
-
- { events }
- procedure check_visible_and_show_hide(
- sender:tobject);
-
- procedure hide_form;
- procedure show_form;
- end;
-
- var
- scope_config: Tscope_config;
-
- implementation
-
- uses
- ntc_server_network, ntc_server_focus, ntc_server_tracking;
-
- {$R *.dfm}
-
- { -------------
- form handling
- ------------- }
-
- procedure tscope_config.update_precision_label;
- begin
- if scope_config.high_precision then
- precision_label.caption:=high_precision_text
- else
- precision_label.caption:=low_precision_text;
- end;
-
- procedure tscope_config.formcreate(
- Sender:TObject);
- begin
- scope_enabled:=true;
- scope_type:=autostar_type;
- binary_check.enabled:=false;
- binary_mode:=false;
- load_settings;
- with scope_observer,current_object do
- begin
- update_precision_label;
- case scope_type of
- lx200_type:
- begin
- if scope_config.high_precision then
- hp_group.visible:=true;
- end;
- autostar_type:
- begin
- if scope_config.high_precision then
- hp_group.visible:=true;
- end;
- celestron_type:
- begin
- if scope_config.high_precision then
- hp_group.visible:=true;
- end;
- end;
- end;
- end;
-
- { ---------
- utilities
- --------- }
-
- function tscope_config.get_precision
- :boolean;
- begin
- result:=scope_config.high_precision;
- end;
-
- { ----------------------
- configuration settings
- ---------------------- }
-
- procedure tscope_config.load_settings;
- begin
- ini_file:=tinifile.create(application_path+'server.ini');
- with ini_file do
- begin
- scope_enabled:=readbool('config','scope_enabled',true);
- enable_scope_check.checked:=scope_enabled;
- century_bug:=readbool('config','century_bug',false);
- century_check.checked:=century_bug;
- seconds_bug:=readbool('config','seconds_bug',false);
- seconds_check.checked:=seconds_bug;
- scope_type:=readinteger('config','scope_type',default_scope_type);
- if (scope_type<first_scope_type) or (scope_type>last_scope_type) then
- scope_type:=default_scope_type;
- model_list.itemindex:=scope_type-1;
- binary_mode:=readbool('config','binary',false);
- binary_check.enabled:=scope_type=celestron_type;
- binary_check.checked:=binary_mode;
- { form }
- scope.get_dimensions(scope_config,@dimensions,'config',ini_file);
- left:=dimensions.form_left;
- top:=dimensions.form_top;
- visible:=readbool('config','visible',false);
- end;
- ini_file.free;
- end;
-
- procedure tscope_config.save_settings;
- begin
- with ini_file do
- begin
- writebool('config','scope_enabled',scope_enabled);
- writebool('config','century_bug',century_bug);
- writebool('config','seconds_bug',seconds_bug);
- writeinteger('config','scope_type',scope_type);
- writebool('config','binary',binary_mode);
- { form }
- scope.find_vdu(scope_config,@dimensions);
- scope.write_dimensions(@dimensions,left,top,'config',ini_file);
- writebool('config','visible',visible);
- end;
- end;
-
- procedure tscope_config.write_escape_scopes;
- var
- ini_file:tinifile;
- begin
- ini_file:=tinifile.create(application_path+'lx200.ini');
- with ini_file do
- begin
- writestring('switch_precision','write','#:U#');
- writebool('switch_precision','append',false);
- writebool('switch_precision','returns',false);
-
- writestring('query','write','#:GR#');
- writebool('query','append',false);
- writebool('query','returns',true);
- writestring('query','object','$*$');
-
- writestring('stopped','write',':D#');
- writebool('stopped','append',false);
- writebool('stopped','returns',true);
- writestring('stopped','valid','$valid=#$');
-
- writestring('get_ra','write','#:GR#');
- writebool('get_ra','append',false);
- writebool('get_ra','returns',true);
- writestring('get_ra','high','$hms$');
- writestring('get_ra','low','$hmt$');
-
- writestring('get_dec','write','#:GD#');
- writebool('get_dec','append',false);
- writebool('get_dec','returns',true);
- writestring('get_dec','high','$dms$');
- writestring('get_dec','low','$dm$');
-
- writestring('get_alt','write','#:GA#');
- writebool('get_alt','append',false);
- writebool('get_alt','returns',true);
- writestring('get_alt','high','$dms$');
- writestring('get_alt','low','$dm$');
-
- writestring('get_az','write','#:GZ#');
- writebool('get_az','append',false);
- writebool('get_az','returns',true);
- writestring('get_az','high','$ddms$');
- writestring('get_az','low','$ddmt$');
-
- writestring('set_ra','write','#:Sr');
- writebool('set_ra','append',true);
- writestring('set_ra','high','$hms$#');
- writestring('set_ra','low','$hmt$#');
- writebool('set_ra','returns',true);
- writestring('set_ra','valid','$valid=1$');
-
- writestring('set_dec','write','#:Sd');
- writebool('set_dec','append',true);
- writestring('set_dec','high','$dms$#');
- writestring('set_dec','low','$dm$#');
- writebool('set_dec','returns',true);
- writestring('set_dec','valid','$valid=1$');
-
- writestring('set_alt','write','#:Sa');
- writebool('set_alt','append',true);
- writestring('set_alt','high','$ams$#');
- writestring('set_alt','low','$am$#');
- writebool('set_alt','returns',true);
- writestring('set_alt','valid','$valid=1$');
-
- writestring('set_az','write','#:Sz');
- writebool('set_az','append',true);
- writestring('set_az','high','$ddms$#');
- writestring('set_az','low','$ddmt$#');
- writebool('set_az','returns',false);
-
- writestring('slew_ra','write','#:MS#');
- writebool('slew_ra','append',false);
- writebool('slew_ra','returns',true);
- writestring('slew_ra','valid','$valid=0$');
-
- writestring('slew_az','write','#:MA#');
- writebool('slew_az','append',false);
- writebool('slew_az','returns',true);
- writestring('slew_az','valid','$valid=0$');
-
- writestring('sync','write','#:CM#');
- writebool('sync','append',false);
- writebool('sync','returns',true);
- writestring('sync','object','$*$');
-
- writestring('speed_slew','write','#:RS#');
- writebool('speed_slew','append',false);
- writebool('speed_slew','returns',false);
-
- writestring('speed_move','write','#:RM#');
- writebool('speed_move','append',false);
- writebool('speed_move','returns',false);
-
- writestring('speed_guide','write','#:RG#');
- writebool('speed_guide','append',false);
- writebool('speed_guide','returns',false);
-
- writestring('speed_centre','write','#:RC#');
- writebool('speed_centre','append',false);
- writebool('speed_centre','returns',false);
-
- writestring('speed','write','#:Sw');
- writebool('speed','append',true);
- writestring('speed','speed','$[2-4]$#');
- writebool('speed','returns',true);
- writestring('speed','value','$*$');
-
- writestring('move_north','write','#:Mn#');
- writebool('move_north','append',false);
- writebool('move_north','returns',false);
-
- writestring('move_east','write','#:Me#');
- writebool('move_east','append',false);
- writebool('move_east','returns',false);
-
- writestring('move_south','write','#:Ms#');
- writebool('move_south','append',false);
- writebool('move_south','returns',false);
-
- writestring('move_west','write','#:Mw#');
- writebool('move_west','append',false);
- writebool('move_west','returns',false);
-
- writestring('stop_north','write','#:Qn#');
- writebool('stop_north','append',false);
- writebool('stop_north','returns',false);
-
- writestring('stop_east','write','#:Qe#');
- writebool('stop_east','append',false);
- writebool('stop_east','returns',false);
-
- writestring('stop_south','write','#:Qs#');
- writebool('stop_south','append',false);
- writebool('stop_south','returns',false);
-
- writestring('stop_west','write','#:Qw#');
- writebool('stop_west','append',false);
- writebool('stop_west','returns',false);
-
- writestring('stop_all','write','#:Q#');
- writebool('stop_all','append',false);
- writebool('stop_all','returns',false);
-
- writestring('stop_move','write','#:Q#:Qn#:Qs#:Qe#:Qw#');
- writebool('stop_move','append',false);
- writebool('stop_move','returns',false);
-
- writestring('focus_fast','write','#:FF#');
- writebool('focus_fast','append',false);
- writebool('focus_fast','returns',false);
-
- writestring('focus_slow','write','#:FS#');
- writebool('focus_slow','append',false);
- writebool('focus_slow','returns',false);
-
- writestring('focus_speed','write','#:F');
- writebool('focus_speed','append',true);
- writestring('focus_speed','speed','$[1-4]$#');
- writebool('focus_speed','returns',false);
-
- writestring('focus_in','write','#:F+#');
- writebool('focus_in','append',false);
- writebool('focus_in','returns',false);
-
- writestring('focus_out','write','#:F-#');
- writebool('focus_out','append',false);
- writebool('focus_out','returns',false);
-
- writestring('focus_stop','write','#:FQ#');
- writebool('focus_stop','append',false);
- writebool('focus_stop','returns',false);
-
- writestring('tracking_increase','write','#:T+#');
- writebool('tracking_increase','append',false);
- writebool('tracking_increase','returns',false);
-
- writestring('tracking_decrease','write','#:T-#');
- writebool('tracking_decrease','append',false);
- writebool('tracking_decrease','returns',false);
-
- writestring('tracking_default','write','#:TQ#');
- writebool('tracking_default','append',false);
- writebool('tracking_default','returns',false);
-
- writestring('tracking_lunar','write','#:TL#');
- writebool('tracking_lunar','append',false);
- writebool('tracking_lunar','returns',false);
- end;
- ini_file.free;
- ini_file:=tinifile.create(application_path+'autostar.ini');
- with ini_file do
- begin
- writestring('switch_precision','write','#:U#');
- writebool('switch_precision','append',false);
- writebool('switch_precision','returns',false);
-
- writestring('query','write','#:GR#');
- writebool('query','append',false);
- writebool('query','returns',true);
- writestring('query','object','$*$');
-
- writestring('stopped','write',':D#');
- writebool('stopped','append',false);
- writebool('stopped','returns',true);
- writestring('stopped','valid','$valid!#$');
-
- writestring('get_ra','write','#:GR#');
- writebool('get_ra','append',false);
- writebool('get_ra','returns',true);
- writestring('get_ra','high','$hms$');
- writestring('get_ra','low','$hmt$');
-
- writestring('get_dec','write','#:GD#');
- writebool('get_dec','append',false);
- writebool('get_dec','returns',true);
- writestring('get_dec','high','$dms$');
- writestring('get_dec','low','$dm$');
-
- writestring('get_alt','write','#:GA#');
- writebool('get_alt','append',false);
- writebool('get_alt','returns',true);
- writestring('get_alt','high','$dms$');
- writestring('get_alt','low','$dm$');
-
- writestring('get_az','write','#:GZ#');
- writebool('get_az','append',false);
- writebool('get_az','returns',true);
- writestring('get_az','high','$ddms$');
- writestring('get_az','low','$ddmt$');
-
- writestring('set_ra','write','#:Sr');
- writebool('set_ra','append',true);
- writestring('set_ra','high','$hms$#');
- writestring('set_ra','low','$hmt$#');
- writebool('set_ra','returns',true);
- writestring('set_ra','valid','$valid=1$');
-
- writestring('set_dec','write','#:Sd');
- writebool('set_dec','append',true);
- writestring('set_dec','high','$dms$#');
- writestring('set_dec','low','$dm$#');
- writebool('set_dec','returns',true);
- writestring('set_dec','valid','$valid=1$');
-
- writestring('set_alt','write','#:Sa');
- writebool('set_alt','append',true);
- writestring('set_alt','high','$ams$#');
- writestring('set_alt','low','$am$#');
- writebool('set_alt','returns',true);
- writestring('set_alt','valid','$valid=1$');
-
- writestring('set_az','write','#:Sz');
- writebool('set_az','append',true);
- writestring('set_az','high','$ddms$#');
- writestring('set_az','low','$ddmt$#');
- writebool('set_az','returns',false);
-
- writestring('slew_ra','write','#:MS#');
- writebool('slew_ra','append',false);
- writebool('slew_ra','returns',true);
- writestring('slew_ra','valid','$valid=0$');
-
- writestring('slew_az','write','#:MA#');
- writebool('slew_az','append',false);
- writebool('slew_az','returns',true);
- writestring('slew_az','valid','$valid=0$');
-
- writestring('sync','write','#:CM#');
- writebool('sync','append',false);
- writebool('sync','returns',true);
- writestring('sync','object','$*$');
-
- writestring('speed_slew','write','#:RS#');
- writebool('speed_slew','append',false);
- writebool('speed_slew','returns',false);
-
- writestring('speed_move','write','#:RM#');
- writebool('speed_move','append',false);
- writebool('speed_move','returns',false);
-
- writestring('speed_guide','write','#:RG#');
- writebool('speed_guide','append',false);
- writebool('speed_guide','returns',false);
-
- writestring('speed_centre','write','#:RC#');
- writebool('speed_centre','append',false);
- writebool('speed_centre','returns',false);
-
- writestring('speed','write','#:Sw');
- writebool('speed','append',true);
- writestring('speed','speed','$[2-4]$#');
- writebool('speed','returns',true);
- writestring('speed','value','$*$');
-
- writestring('move_north','write','#:Mn#');
- writebool('move_north','append',false);
- writebool('move_north','returns',false);
-
- writestring('move_east','write','#:Me#');
- writebool('move_east','append',false);
- writebool('move_east','returns',false);
-
- writestring('move_south','write','#:Ms#');
- writebool('move_south','append',false);
- writebool('move_south','returns',false);
-
- writestring('move_west','write','#:Mw#');
- writebool('move_west','append',false);
- writebool('move_west','returns',false);
-
- writestring('stop_north','write','#:Qn#');
- writebool('stop_north','append',false);
- writebool('stop_north','returns',false);
-
- writestring('stop_east','write','#:Qe#');
- writebool('stop_east','append',false);
- writebool('stop_east','returns',false);
-
- writestring('stop_south','write','#:Qs#');
- writebool('stop_south','append',false);
- writebool('stop_south','returns',false);
-
- writestring('stop_west','write','#:Qw#');
- writebool('stop_west','append',false);
- writebool('stop_west','returns',false);
-
- writestring('stop_all','write','#:Q#');
- writebool('stop_all','append',false);
- writebool('stop_all','returns',false);
-
- writestring('stop_move','write','#:Q#:Qn#:Qs#:Qe#:Qw#');
- writebool('stop_move','append',false);
- writebool('stop_move','returns',false);
-
- writestring('focus_fast','write','#:FF#');
- writebool('focus_fast','append',false);
- writebool('focus_fast','returns',false);
-
- writestring('focus_slow','write','#:FS#');
- writebool('focus_slow','append',false);
- writebool('focus_slow','returns',false);
-
- writestring('focus_speed','write','#:F');
- writebool('focus_speed','append',true);
- writestring('focus_speed','speed','$[1-4]$#');
- writebool('focus_speed','returns',false);
-
- writestring('focus_in','write','#:F+#');
- writebool('focus_in','append',false);
- writebool('focus_in','returns',false);
-
- writestring('focus_out','write','#:F-#');
- writebool('focus_out','append',false);
- writebool('focus_out','returns',false);
-
- writestring('focus_stop','write','#:FQ#');
- writebool('focus_stop','append',false);
- writebool('focus_stop','returns',false);
-
- writestring('tracking_increase','write','#:T+#');
- writebool('tracking_increase','append',false);
- writebool('tracking_increase','returns',false);
-
- writestring('tracking_decrease','write','#:T-#');
- writebool('tracking_decrease','append',false);
- writebool('tracking_decrease','returns',false);
-
- writestring('tracking_default','write','#:TQ#');
- writebool('tracking_default','append',false);
- writebool('tracking_default','returns',false);
-
- writestring('tracking_lunar','write','#:TL#');
- writebool('tracking_lunar','append',false);
- writebool('tracking_lunar','returns',false);
- end;
- ini_file:=tinifile.create(application_path+'celestron.ini');
- with ini_file do
- begin
- writestring('query','write','?');
- writebool('query','append',false);
- writebool('query','returns',true);
- writestring('query','valid','$valid=#$');
-
- writestring('stopped','write','L');
- writebool('stopped','append',false);
- writebool('stopped','returns',true);
- writestring('stopped','valid','$valid=0#$');
-
- writestring('get_ra_dec','write','E');
- writebool('get_ra_dec','append',false);
- writebool('get_ra_dec','returns',true);
- writestring('get_ra_dec','high','$ra_hex32$,$dec_hex32$#');
- writestring('get_ra_dec','low','$ra_hex$,$dec_hex$#');
-
- writestring('get_az_alt','write','Z');
- writebool('get_az_alt','append',false);
- writebool('get_az_alt','returns',true);
- writestring('get_az_alt','high','$az_hex32$,$alt_hex32$#');
- writestring('get_az_alt','low','$az_hex$,$alt_hex$#');
-
- writestring('goto_ra_dec','write','R');
- writebool('goto_ra_dec','append',true);
- writestring('goto_ra_dec','high','$ra_hex32$,$dec_hex32$');
- writestring('goto_ra_dec','low','$ra_hex$,$dec_hex$');
- writebool('goto_ra_dec','returns',true);
- writestring('goto_ra_dec','valid','$valid=#$');
-
- writestring('goto_az_alt','write','B');
- writebool('goto_az_alt','append',true);
- writestring('goto_az_alt','high','$az_hex32$,$alt_hex32$');
- writestring('goto_az_alt','low','$az_hex$,$alt_hex$');
- writebool('goto_az_alt','returns',true);
- writestring('goto_az_alt','valid','$valid=#$');
-
- writestring('get_ra_dec_bin','write','E');
- writebool('get_ra_dec_bin','append',false);
- writebool('get_ra_dec_bin','returns',true);
- writestring('get_ra_dec_bin','high','$ra_bin32$$dec_bin32$#');
- writestring('get_ra_dec_bin','low','$ra_bin$$dec_bin$#');
-
- writestring('get_az_alt_bin','write','Z');
- writebool('get_az_alt_bin','append',false);
- writebool('get_az_alt_bin','returns',true);
- writestring('get_az_alt_bin','high','$az_bin32$$alt_bin32$#');
- writestring('get_az_alt_bin','low','$az_bin$$alt_bin$#');
-
- writestring('goto_az_alt_bin','write','R');
- writebool('goto_az_alt_bin','append',true);
- writestring('goto_az_alt_bin','high','$ra_bin32$$dec_bin32$');
- writestring('goto_az_alt_bin','low','$ra_bin$$dec_bin$');
- writebool('goto_az_alt_bin','returns',true);
- writestring('goto_az_alt_bin','valid','$valid=#$');
-
- writestring('goto_az_alt_bin','write','B');
- writebool('goto_az_alt_bin','append',true);
- writestring('goto_az_alt_bin','high','$az_bin32$$alt_bin32$');
- writestring('goto_az_alt_bin','low','$az_bin$$alt_bin$');
- writebool('goto_az_alt_bin','returns',true);
- writestring('goto_az_alt_bin','valid','$valid=#$');
-
- writestring('tracking_off','write','T0');
- writebool('tracking_off','append',false);
- writebool('tracking_off','returns',true);
- writestring('tracking_off','valid','$valid=#$');
-
- writestring('tracking_az','write','T1');
- writebool('tracking_az','append',false);
- writebool('tracking_az','returns',true);
- writestring('tracking_az','valid','$valid=#$');
-
- writestring('tracking_eq_north','write','T2');
- writebool('tracking_eq_north','append',false);
- writebool('tracking_eq_north','returns',true);
- writestring('tracking_eq_north','valid','$valid=#$');
-
- writestring('tracking_eq_south','write','T3');
- writebool('tracking_eq_south','append',false);
- writebool('tracking_eq_south','returns',true);
- writestring('tracking_eq_south','valid','$valid=#$');
- end;
- ini_file.free;
- end;
-
- { ------
- events
- ------ }
-
- procedure tscope_config.FormShow(
- Sender: TObject);
- begin
- with dimensions do
- begin
- top:=form_top;
- left:=form_left;
- end;
- with precision_label do
- begin
- width:=137;
- update_precision_label;
- end;
- end;
-
- procedure tscope_config.adjust;
- begin
- with dimensions do
- begin
- form_top:=trunc(form_top/last_screen_height*current_height);
- form_left:=trunc(form_left/last_screen_width*current_width);
- end;
- if visible then
- show;
- end;
-
- procedure tscope_config.check_visible_and_show_hide(
- sender:tobject);
- begin
- if visible then
- hide_form
- else
- show_form;
- scope.show_hide(sender,visible);
- end;
-
- procedure tscope_config.hide_form;
- begin
- with dimensions do
- begin
- form_top:=top;
- form_left:=left;
- end;
- Visible:=false;
- end;
-
- procedure tscope_config.show_form;
- begin
- Visible:=true;
- end;
-
- procedure Tscope_config.check_activate(
- Sender: TObject);
- begin
- scope.form_activate(scope_config,@dimensions);
- end;
-
- procedure Tscope_config.form_close_query(
- Sender: TObject;
- var CanClose: Boolean);
- begin
- canclose:=false;
- visible:=false;
- with dimensions do
- begin
- form_top:=top;
- form_left:=left;
- end;
- end;
-
- procedure tscope_config.model_listChange(
- Sender:TObject);
- var
- toggle:boolean;
- begin
- scope_comms.command_list.free;
- with scope_observer do
- case model_list.itemindex+1 of
- lx200_type:
- begin
- scope_type:=lx200_type;
- observatory_group.visible:=true;
- if scope_config.high_precision then
- hp_group.visible:=true;
- toggle:=true;
- end;
- autostar_type:
- begin
- scope_type:=autostar_type;
- observatory_group.visible:=true;
- if scope_config.high_precision then
- hp_group.visible:=true;
- toggle:=true;
- end;
- celestron_type:
- begin
- scope_type:=celestron_type;
- observatory_group.Visible:=true;
- if scope_config.high_precision then
- hp_group.visible:=true;
- toggle:=false;
- end;
- else
- begin
- observatory_group.visible:=true;
- if scope_config.high_precision then
- hp_group.visible:=true;
- toggle:=true;
- end;
- end;
- scope_focus.flip_buttons(toggle);
- scope_tracking.flip_buttons(toggle);
- scope_comms.read_escape_scopes;
- end;
-
- procedure tscope_config.switch_hpp_buttonClick(
- Sender:TObject);
- begin
- if scope_enabled then
- begin
- if scope_type=celestron_type then
- begin
- high_precision:=not high_precision;
- update_precision_label;
- end
- else if scope_network.send_message_check('switch_precision')>=[exit_ok] then
- begin
- high_precision:=get_precision;
- update_precision_label;
- end
- else
- precision_label.caption:='Precision unknown';
- end
- else
- begin
- high_precision:=not high_precision;
- update_precision_label;
- end;
- end;
-
- procedure Tscope_config.make_inisClick(
- Sender: TObject);
- begin
- write_escape_scopes;
- with scope_comms do
- begin
- if command_list<>nil then
- command_list.free;
- read_escape_scopes;
- end;
- end;
-
- procedure Tscope_config.enable_scope_checkClick(
- Sender: TObject);
- begin
- scope_enabled:=enable_scope_check.checked;
- end;
-
- procedure Tscope_config.century_checkClick(
- Sender: TObject);
- begin
- century_bug:=century_check.checked;
- end;
-
- procedure Tscope_config.seconds_checkClick(
- Sender: TObject);
- begin
- seconds_bug:=seconds_check.checked;
- end;
-
- procedure Tscope_config.binary_checkClick(
- Sender: TObject);
- begin
- binary_mode:=binary_check.Checked;
- end;
-
- end.